namespace Maple.Branch.IdentityServer.IRepositories
{
    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Entities;
    using Volo.Abp.Domain.Repositories;

    public interface IDeviceFlowCodeRepository : IBasicRepository<DeviceFlowCode, Guid>
    {
        Task<DeviceFlowCode> FindByUserCodeAsync(
            string userCode,
            CancellationToken cancellationToken = default
        );

        Task<DeviceFlowCode> FindByDeviceCodeAsync(
            string deviceCode,
            CancellationToken cancellationToken = default
        );

        Task<List<DeviceFlowCode>> GetListByExpirationAsync(
            DateTime maxExpirationDate,
            int maxResultCount,
            CancellationToken cancellationToken = default
        );
    }
}
